export class Result<T> {
    msg: string
    code: number
    supportCode: any
    data: T
    ok?: boolean
    message?: string
    constructor(msg: string, code: number, supportCode: any, data: T) {
        this.msg = msg
        this.code = code
        this.data = data
        this.supportCode = supportCode
    }

    static success(data: any) {
        return new Result('请求成功', 0, null, data)
    }
    static error(message: string, code: number) {
        return new Result(message, code, null, null)
    }
}

interface Page<T> {
    /**
     *分页数据
     */
    records: Array<T>
    /**
     *当前页
     */
    current: number
    /**
     * 每页展示size
     */
    size: number
    /**
     *总数
     */
    total: number
    /**
     *是否有下一页
     */
    hasNext: boolean
}
export type { Page }
export default Result
